import { Rule } from "./types";

export const PycodeStyleErrorRuleList: Rule[] = [
    {
        code: "E101",
        name: "mixed-spaces-and-tabs",
        descEn: "Indentation contains mixed spaces and tabs",
        descCn: "",
        autoFix: false,
    },
    {
        code: "E401",
        name: "multiple-imports-on-one-line",
        descEn: "Multiple imports on one line",
        descCn: "",
        autoFix: false,
    },
    {
        code: "E402",
        name: "module-import-not-at-top-of-file",
        descEn: "Module level import not at top of file",
        descCn: "",
        autoFix: false,
    },
    {
        code: "E501",
        name: "line-too-long",
        descEn: "Line too long ({width} > {limit} characters)",
        descCn: "",
        autoFix: false,
    },
    {
        code: "E701",
        name: "multiple-statements-on-one-line-colon",
        descEn: "Multiple statements on one line (colon)",
        descCn: "",
        autoFix: false,
    },
    {
        code: "E702",
        name: "multiple-statements-on-one-line-semicolon",
        descEn: "Multiple statements on one line (semicolon)	",
        descCn: "",
        autoFix: false,
    },
    {
        code: "E703",
        name: "useless-semicolon",
        descEn: "Statement ends with an unnecessary semicolon",
        descCn: "",
        autoFix: true,
    },
    {
        code: "E711",
        name: "none-comparison",
        descEn: "Comparison to None should be cond is None",
        descCn: "",
        autoFix: true,
    },
    {
        code: "E712",
        name: "true-false-comparison",
        descEn: "Comparison to True should be cond is True or if cond:",
        descCn: "",
        autoFix: true,
    },
    {
        code: "E713",
        name: "not-in-test",
        descEn: "Test for membership should be not in",
        descCn: "",
        autoFix: true,
    },
    {
        code: "E714",
        name: "not-is-test",
        descEn: "Test for object identity should be is not",
        descCn: "",
        autoFix: true,
    },
    {
        code: "E721",
        name: "type-comparison",
        descEn: "Do not compare types, use isinstance()",
        descCn: "",
        autoFix: false,
    },
    {
        code: "E722",
        name: "bare-except",
        descEn: "Do not use bare except",
        descCn: "",
        autoFix: false,
    },
    {
        code: "E731",
        name: "lambda-assignment",
        descEn: "Do not assign a lambda expression, use a def",
        descCn: "",
        autoFix: true,
    },
    {
        code: "E741",
        name: "ambiguous-variable-name",
        descEn: "Ambiguous variable name: {name}",
        descCn: "",
        autoFix: false,
    },
    {
        code: "E742",
        name: "ambiguous-class-name",
        descEn: "Ambiguous class name: {name}",
        descCn: "",
        autoFix: false,
    },
    {
        code: "E743",
        name: "ambiguous-function-name",
        descEn: "Ambiguous function name: {name}	",
        descCn: "",
        autoFix: false,
    },
    {
        code: "E902",
        name: "io-error",
        descEn: "{message}",
        descCn: "",
        autoFix: false,
    },
    {
        code: "E999",
        name: "syntax-error",
        descEn: "SyntaxError:",
        descCn: "",
        autoFix: false,
    },
];

export const PycodeStyleWarnRuleList: Rule[] = [
    {
        code: "W191",
        name: "tab-indentation",
        descEn: "Indentation contains tabs",
        descCn: "",
        autoFix: false,
    },
    {
        code: "W291",
        name: "trailing-whitespace",
        descEn: "Trailing whitespace",
        descCn: "",
        autoFix: true,
    },
    {
        code: "W292",
        name: "missing-newline-at-end-of-file",
        descEn: "No newline at end of file",
        descCn: "",
        autoFix: true,
    },
    {
        code: "W293",
        name: "blank-line-with-whitespace",
        descEn: "Blank line contains whitespace",
        descCn: "",
        autoFix: true,
    },
    {
        code: "W505",
        name: "doc-line-too-long",
        descEn: "Doc line too long ({width} > {limit} characters)",
        descCn: "",
        autoFix: false,
    },
    {
        code: "W605",
        name: "invalid-escape-sequence",
        descEn: "Invalid escape sequence: \\{char}",
        descCn: "",
        autoFix: true,
    },
];